NestJS ships a built-in global exception filter that catches every unhandled exception automatically. For HttpException it serializes the response body and sends the correct HTTP status. For any other exception type it returns a generic 500 Internal Server Error response, hiding implementation details from the client.
Always active — runs even without any custom filter configuration.
HttpException — serializes the response body from getResponse() with the correct status code.
Non-HttpException — returns a generic 500 response, never exposing internal error details.
Custom filters extend or override this behavior but never fully remove it.
The built-in layer acts as the final safety net behind all custom filters.
You have a simple GET endpoint that throws a new Error('oops'). What does the client receive if you haven't added any custom exception filter?
If a controller method throws a NestJS HttpException with status 404, what shape of response does the built‑in global layer send back?
When an exception propagates out of a service call and you haven't caught it, how does NestJS handle the response automatically?
Your API is returning generic 500 responses even for validation errors. Explain why this is happening in terms of the default global exception layer.
During debugging you added console logs in a service, but the client still sees a generic error. How would you confirm that the built‑in exception handler is formatting the response?
If you need to change the error payload format without writing a full filter, what options does Nest provide given the default behavior?
In a microservice setup you need to propagate richer error details across services. What limitations does the built‑in global exception layer have, and how would you extend it without breaking existing clients?
At high traffic you notice stack traces being logged for every error, hurting performance. How would you adjust the default global exception handling to reduce overhead while keeping useful diagnostics?
You must integrate a third‑party monitoring tool that expects a specific error payload. How would you intercept the built‑in exception flow to inject that payload globally?
Your organization is migrating legacy Express error handling into NestJS. How would you plan the transition considering the built‑in global exception layer to ensure backward compatibility across many teams?
When designing a shared library for error handling used by dozens of NestJS services, what architectural decisions would you make about extending or replacing the default global exception layer?
Discuss the trade‑offs of disabling Nest's default exception layer in favor of a custom global filter in a large, multi‑tenant SaaS platform.